home *** CD-ROM | disk | FTP | other *** search
/ Skunkware 98 / Skunkware 98.iso / osr5 / devtools / dejagnu-971222 / usr / local / share / dejagnu / libgloss.exp < prev    next >
Encoding:
Text File  |  1998-03-22  |  17.0 KB  |  740 lines

  1. # Copyright (C) 92, 93, 94, 95, 96, 1997 Free Software Foundation, Inc.
  2.  
  3. # This program is free software; you can redistribute it and/or modify
  4. # it under the terms of the GNU General Public License as published by
  5. # the Free Software Foundation; either version 2 of the License, or
  6. # (at your option) any later version.
  7. # This program is distributed in the hope that it will be useful,
  8. # but WITHOUT ANY WARRANTY; without even the implied warranty of
  9. # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  10. # GNU General Public License for more details.
  11. # You should have received a copy of the GNU General Public License
  12. # along with this program; if not, write to the Free Software
  13. # Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. 
  14.  
  15. # Please email any bugs, comments, and/or additions to this file to:
  16. # bug-dejagnu@prep.ai.mit.edu
  17.  
  18. # This file was written by Rob Savoye. (rob@cygnus.com)
  19.  
  20. # this contains a list of gcc options and their respective directories.
  21.  
  22. #
  23. # Find the pieces of libgloss for testing the GNU development tools
  24. # needed to link a set of object files into an executable.
  25. # This usually means setting the -L and -B paths correctly.
  26. #
  27. proc libgloss_link_flags { args } {
  28.     global target_cpu
  29.     global srcdir
  30.  
  31.     # libgloss doesn't work native
  32.     if [isnative] {
  33.     return ""
  34.     }
  35.  
  36.     # if we're on a remote host, we can't search for the file, so we can only
  37.     # use an installed compiler, so we don't add any paths here.
  38.     if [is_remote host] {
  39.     return ""
  40.     }
  41.  
  42.     set gccpath "[get_multilibs]"
  43.  
  44.     # map the target_cpu to the proper libgloss directory. unfortunately, these
  45.     # directory names are hardcoded into libgloss.
  46.     switch -glob -- $target_cpu {
  47.     "sparclite" {
  48.         set cpu sparc
  49.     }
  50.     "sparclet" {
  51.         set cpu sparc
  52.     }
  53.     "hppa*" {
  54.         set cpu pa
  55.     }
  56.     "mips*" {
  57.         set cpu mips
  58.     }
  59.     "powerpc*" {
  60.         set cpu rs6000
  61.     }
  62.     default {
  63.         set cpu $target_cpu
  64.     }
  65.     }
  66.  
  67.     set gloss_srcdir ""
  68.     # look for the libgloss srcdir sp we can find the linker scripts
  69.     set gloss_srcdir [lookfor_file ${srcdir} libgloss/$cpu]
  70.  
  71.     # set the proper paths for gcc if the target subdir exists, else assume we
  72.     # have no libgloss support for this target.
  73.     if { $gloss_srcdir == "" } {
  74.     return ""
  75.     }
  76.     if [file exists $gccpath/libgloss/$cpu] {
  77.     verbose "Libgloss path is $gccpath/libgloss/$cpu" 2
  78.     return "-B$gccpath/libgloss/$cpu/ -L$gccpath/libgloss/$cpu -L$gloss_srcdir"
  79.     } else {
  80.     verbose -log "No libgloss support for this target." 2
  81.     return "-L$gloss_srcdir"
  82.     }
  83. }
  84.  
  85. # There aren't any, but we'll be orthogonal here.
  86.  
  87. proc libgloss_include_flags { args } {
  88.     return ""
  89. }
  90.  
  91. #
  92. # Find the newlib libraries in the current source tree.
  93. #
  94. proc newlib_link_flags { args } {
  95.     global base_dir
  96.  
  97.     # libgloss doesn't work native
  98.     if [isnative] {
  99.     return ""
  100.     }
  101.  
  102.     # if we're on a remote host, we can't search for the file, so we can only
  103.     # use an installed compiler, so we don't add any paths here.
  104.     if [is_remote host] {
  105.     return ""
  106.     }
  107.  
  108.     set ld_script_path [lookfor_file ${base_dir} "ld/ldscripts"];
  109.     if { $ld_script_path != "" } {
  110.     set result "-L[file dirname $ld_script_path]"
  111.     } else {
  112.     set result ""
  113.     }
  114.  
  115.     set gccpath "[get_multilibs]"
  116.  
  117.     verbose "Looking for $gccpath/newlib"
  118.     if [file exists $gccpath/newlib] {
  119.     verbose "Newlib path is $gccpath/newlib"
  120.     return "$result -B$gccpath/newlib/ -L$gccpath/newlib"
  121.     } else {
  122.     verbose "No newlib support for this target"
  123.     return "$result"
  124.     }
  125. }
  126.  
  127. proc newlib_include_flags { args } {
  128.     global srcdir
  129.  
  130.     if [isnative] {
  131.     return ""
  132.     }
  133.  
  134.     if [is_remote host] {
  135.     return ""
  136.     }
  137.  
  138.     set gccpath "[get_multilibs]"
  139.  
  140.     if [file exists $gccpath/newlib] {
  141.     verbose "Newlib path is $gccpath/newlib"
  142.  
  143.     set newlib_dir [lookfor_file ${srcdir} newlib/libc/include/assert.h]
  144.     if { ${newlib_dir} != "" } {
  145.         set newlib_dir [file dirname ${newlib_dir}]
  146.     }
  147.     return " -I$gccpath/newlib/targ-include -I${newlib_dir}"
  148.     } else {
  149.     verbose "No newlib support for this target"
  150.     }
  151. }
  152.  
  153. proc libio_include_flags { args } {
  154.     global srcdir
  155.     global base_dir
  156.  
  157.     if [is_remote host] {
  158.     return ""
  159.     }
  160.  
  161.     set gccpath "[get_multilibs]"
  162.  
  163.     if { $gccpath == "" } {
  164.     set gccpath [file dirname [file dirname ${base_dir}]]
  165.     }
  166.  
  167.     set libio_bin_dir [lookfor_file ${gccpath} libio/_G_config.h];
  168.  
  169.     # linux doesn't build _G_config.h and the test above fails, so
  170.     # we search for iostream.list too.
  171.     if { $libio_bin_dir == "" } {
  172.     set libio_bin_dir [lookfor_file ${gccpath} libio/iostream.list];
  173.     }
  174.  
  175.     set libio_src_dir [lookfor_file ${srcdir} libio/Makefile.in]
  176.     if { $libio_bin_dir != "" && $libio_src_dir != "" } {
  177.     set libio_src_dir [file dirname ${libio_src_dir}]
  178.     set libio_bin_dir [file dirname ${libio_bin_dir}];
  179.     return " -I${libio_src_dir} -I${libio_bin_dir}"
  180.     } else {
  181.     return ""
  182.     }
  183. }
  184.  
  185. proc libio_link_flags { args } {
  186.     if [is_remote host] {
  187.     return ""
  188.     }
  189.  
  190.     set gccpath "[get_multilibs]"
  191.  
  192.     set libio_dir [lookfor_file ${gccpath} libio/libio.a]
  193.     if { $libio_dir != "" } {
  194.     return "-L[file dirname ${libio_dir}]"
  195.     } else {
  196.     return ""
  197.     }
  198. }
  199.  
  200. proc g++_include_flags { args } {
  201.     global srcdir
  202.  
  203.     if [is_remote host] {
  204.     return ""
  205.     }
  206.  
  207.     set gccpath [get_multilibs]
  208.     set libio_dir ""
  209.     set flags ""
  210.  
  211.     set dir [lookfor_file ${srcdir} libg++]
  212.     if { ${dir} != "" } {
  213.     append flags "-I${dir} -I${dir}/src "
  214.     }
  215.     set dir [lookfor_file ${srcdir} libstdc++]
  216.     if { ${dir} != "" } {
  217.     append flags "-I${dir} -I${dir}/stl"
  218.     }
  219.     return "$flags"
  220. }
  221.  
  222. proc g++_link_flags { args } {
  223.     global srcdir
  224.     global ld_library_path
  225.  
  226.     set gccpath [get_multilibs];
  227.     set libio_dir ""
  228.     set flags ""
  229.     set ld_library_path "."
  230.  
  231.     if { $gccpath != "" } {
  232.     if [file exists "${gccpath}/libg++/libg++.a"] {
  233.         append flags "-L${gccpath}/libg++ "
  234.         append ld_library_path ":${gccpath}/libg++"
  235.     }
  236.     if [file exists "${gccpath}/libstdc++/libstdc++.a"] {
  237.         append flags "-L${gccpath}/libstdc++ "
  238.         append ld_library_path ":${gccpath}/libstdc++"
  239.     }
  240.     if [file exists "${gccpath}/libiberty/libiberty.a"] {
  241.         append flags "-L${gccpath}/libiberty "
  242.     }
  243.     if [file exists "${gccpath}/librx/librx.a"] {
  244.         append flags "-L${gccpath}/librx "
  245.     }
  246.     } else {
  247.     global objdir;
  248.  
  249.     set libgpp [lookfor_file ${objdir} libg++];
  250.     if { $libgpp != "" } {
  251.         append flags "-L${libgpp} ";
  252.         append ld_library_path ":${libgpp}"
  253.     }
  254.     set libstdcpp [lookfor_file ${objdir} libstdc++];
  255.     if { $libstdcpp != "" } {
  256.         append flags "-L${libstdcpp} ";
  257.         append ld_library_path ":${libstdcpp}"
  258.     }
  259.     set libiberty [lookfor_file ${objdir} libiberty];
  260.     if { $libiberty != "" } {
  261.         append flags "-L${libiberty} ";
  262.     }
  263.     set librx [lookfor_file ${objdir} librx];
  264.     if { $librx != "" } {
  265.         append flags "-L${librx} ";
  266.     }
  267.     }
  268.     return "$flags"
  269. }
  270.  
  271. proc libstdc++_include_flags { args } {
  272.     global srcdir
  273.  
  274.     if [is_remote host] {
  275.     return ""
  276.     }
  277.  
  278.     set gccpath [get_multilibs]
  279.     set libio_dir ""
  280.     set flags ""
  281.  
  282.     set dir [lookfor_file ${srcdir} libstdc++]
  283.     if { ${dir} != "" } {
  284.     append flags "-I${dir} -I${dir}/stl"
  285.     }
  286.     return "$flags"
  287. }
  288.  
  289. proc libstdc++_link_flags { args } {
  290.     global srcdir
  291.     global ld_library_path
  292.  
  293.     set gccpath [get_multilibs];
  294.     set libio_dir ""
  295.     set flags ""
  296.  
  297.     if { $gccpath != "" } {
  298.     if [file exists "${gccpath}/libstdc++/libstdc++.a"] {
  299.         append flags "-L${gccpath}/libstdc++ "
  300.         append ld_library_path ":${gccpath}/libstdc++"
  301.     }
  302.     if [file exists "${gccpath}/libiberty/libiberty.a"] {
  303.         append flags "-L${gccpath}/libiberty "
  304.     }
  305.     if [file exists "${gccpath}/librx/librx.a"] {
  306.         append flags "-L${gccpath}/librx "
  307.     }
  308.     } else {
  309.     global objdir;
  310.  
  311.     set libstdcpp [lookfor_file ${objdir} libstdc++];
  312.     if { $libstdcpp != "" } {
  313.         append flags "-L${libstdcpp} ";
  314.         append ld_library_path ":${libstdcpp}"
  315.     }
  316.     set libiberty [lookfor_file ${objdir} libiberty];
  317.     if { $libiberty != "" } {
  318.         append flags "-L${libiberty} ";
  319.     }
  320.     set librx [lookfor_file ${objdir} librx];
  321.     if { $librx != "" } {
  322.         append flags "-L${librx} ";
  323.     }
  324.     }
  325.     return "$flags"
  326. }
  327.  
  328. #
  329. # Get the list of directories and -m options for gcc. This is kinda bogus that
  330. # generic testing software needs support for gcc hardwired in, but to make 
  331. # testing the GNU tools work right, there didn't seem to be any other way.
  332. #
  333.  
  334. proc get_multilibs { args } {
  335.     global target_alias
  336.     global board
  337.     global board_info
  338.  
  339.     # if we're on a remote host, we can't search for the file, so we can only
  340.     # use an installed compiler, so we don't add any paths here.
  341.     if [is_remote host] {
  342.     return ""
  343.     }
  344.  
  345.     if [info exists board] {
  346.     set target_board $board;
  347.     } else {
  348.     set target_board [target_info name];
  349.     }
  350.  
  351.     if { [llength $args] == 0 } {
  352.     if [board_info $target_board exists multitop] {
  353.         return "[board_info $target_board multitop]";
  354.     }
  355.  
  356.     set board_info($target_board,multitop) ""
  357.     }
  358.  
  359.     if { [board_info $target_board exists compiler] } {
  360.     set compiler [board_info $target_board compiler];
  361.     } else {
  362.     set compiler [find_gcc];
  363.     }
  364.  
  365.     if { $compiler == "" } {
  366.     return "";
  367.     }
  368.  
  369.     foreach x "$compiler" {
  370.     if [regexp "^-B" "$x"] {
  371.         regsub "^-B" "$x" "" comp_base_dir;
  372.         set comp_base_dir [file dirname $comp_base_dir];
  373.         break;
  374.     }
  375.     }
  376.     if { [llength $args] > 0 } {
  377.     set mopts [lindex $args 0];
  378.     } else {
  379.     if { [board_info $target_board exists multilib_flags] } {
  380.         set mopts [board_info $target_board multilib_flags];
  381.     } else {
  382.         set mopts ""
  383.     }
  384.     }
  385.  
  386.     regsub "^-" $mopts "" moptions
  387.     regsub -all " -" $moptions " " dirty_moptions
  388.     set moptions ""
  389.     foreach x [split $dirty_moptions " "] {
  390.     if { $x != "" && [lsearch -exact $moptions $x] < 0 } {
  391.         lappend moptions $x
  392.     }
  393.     }
  394.  
  395.     regexp "/.* " $compiler compiler
  396.     set compiler [string trimright $compiler " "]
  397.     verbose "compiler is $compiler"
  398.  
  399.     if ![info exists comp_base_dir] {
  400.     set comp_base_dir [which $compiler];
  401.  
  402.     if { $comp_base_dir == 0 } {
  403.         return "";
  404.     }
  405.  
  406.     set comp_base_dir [file dirname [file dirname $comp_base_dir]];
  407.     } else {
  408.     if { [which $compiler] == 0 } {
  409.         return "";
  410.     }
  411.     }
  412.  
  413.     # extract the options and their directory names as know by gcc
  414.     foreach i "[exec $compiler --print-multi-lib]" {
  415.     set opts ""
  416.     set dir ""
  417.     regexp -- "\[a-z0-9/\.-\]*;" $i dir
  418.     set dir [string trimright $dir "\;@"]
  419.     regexp -- "\;@*\[\@a-zA-Z0-9/\.-\]*" $i opts
  420.     set opts [split [string trimleft $opts "\;@"] "@"]
  421.     lappend multilibs "$dir {$opts }"
  422.     }
  423.  
  424.  
  425.     # search for the top level multilib directory
  426.     set multitop [lookfor_file "${comp_base_dir}" "${target_alias}"]
  427.     if { $multitop == "" } {
  428.     set multitop [lookfor_file "${comp_base_dir}" "libraries"]
  429.     if { $multitop == "" } {
  430.         set multitop "[lookfor_file ${comp_base_dir} gcc/xgcc]"
  431.         if { $multitop != "" } {
  432.         set multitop [file dirname [file dirname $multitop]];
  433.         } else {
  434.         return ""
  435.         }
  436.     }
  437.     }
  438.  
  439.     # make a list of -m<foo> options from the various compiler config variables
  440.     set gccpath ""
  441.  
  442.     # compare the lists of gcc options with the list of support multilibs
  443.     verbose "Supported multilibs are: $multilibs" 3
  444.     set best 0;
  445.     foreach i "$multilibs" {
  446.     set hits 0
  447.     set opts [lindex $i 1];
  448.     if { [llength $opts] <= [llength $moptions] } {
  449.         foreach j "$moptions" {
  450.         # see if all the -m<foo> options match any of the multilibs
  451.         verbose "Looking in $i for $j" 3
  452.         if { [lsearch -exact $opts $j] >= 0 } {
  453.             incr hits
  454.         }
  455.         }
  456.  
  457.         if { $hits > $best } {
  458.         verbose "[lindex $i 0] is better, using as gcc path" 2
  459.         set gccpath "[lindex $i 0]"
  460.         set best $hits;
  461.         }
  462.     }
  463.     }
  464.     if ![info exists multitop] {
  465.     return "";
  466.     }
  467.  
  468.     verbose "gccpath is $gccpath" 3
  469.  
  470.     if [file exists $multitop/$gccpath] {
  471.     verbose "GCC path is $multitop/$gccpath" 3
  472.     if { [llength $args] == 0 } {
  473.         set board_info($target_board,multitop) "$multitop/$gccpath"
  474.     }
  475.     return "$multitop/$gccpath"
  476.     } else {
  477.     verbose "GCC path is $multitop" 3
  478.     if { [llength $args] == 0 } {
  479.         set board_info($target_board,multitop) "$multitop"
  480.     }
  481.     return "$multitop"
  482.     }
  483. }
  484.  
  485. proc find_binutils_prog { name } {
  486.     global base_dir;
  487.  
  488.     if ![is_remote host] {
  489.     
  490.     set file [lookfor_file $base_dir $name];
  491.     if { $file == "" } {
  492.         set file [lookfor_file $base_dir ${name}-new];
  493.     }
  494.     if { $file == "" } {
  495.         set file [lookfor_file $base_dir binutils/$name];
  496.     }
  497.     if { $file == "" } {
  498.         set file [lookfor_file $base_dir binutils/${name}-new];
  499.     }
  500.     if { $file != "" } {
  501.         set NAME "$file";
  502.     } else {
  503.         set NAME [transform $name];
  504.     }
  505.     } else {
  506.     set NAME [transform $name]
  507.     }
  508.     return $NAME;
  509. }
  510.  
  511. proc find_gcc {} {
  512.     global base_dir
  513.  
  514.     if ![is_remote host] {
  515.     set file [lookfor_file $base_dir xgcc];
  516.     if { $file == "" } {
  517.         set file [lookfor_file $base_dir gcc/xgcc];
  518.     }
  519.     if { $file != "" } {
  520.         set CC "$file -B[file dirname $file]/";
  521.     } else {
  522.         set CC [transform gcc];
  523.     }
  524.     } else {
  525.     set CC [transform gcc]
  526.     }
  527.     return $CC;
  528. }
  529.  
  530. proc find_g++ {} {
  531.     global base_dir
  532.  
  533.     if ![is_remote host] {
  534.     set file [lookfor_file $base_dir g++];
  535.     if { $file == "" } {
  536.         set file [lookfor_file $base_dir gcc/g++];
  537.     }
  538.     if { $file != "" } {
  539.         set CC "$file -B[file dirname $file]/";
  540.     } else {
  541.         set CC [transform g++];
  542.     }
  543.     } else {
  544.     set CC [transform g++]
  545.     }
  546.     return $CC;
  547. }
  548.  
  549. proc find_g77 {} {
  550.     global base_dir
  551.  
  552.     if ![is_remote host] {
  553.     set file [lookfor_file $base_dir g77];
  554.     if { $file == "" } {
  555.         set file [lookfor_file $base_dir gcc/g77];
  556.     }
  557.     if { $file != "" } {
  558.         set CC "$file -B[file dirname $file]/";
  559.     } else {
  560.         set CC [transform g77];
  561.     }
  562.     } else {
  563.     set CC [transform g77]
  564.     }
  565.     return $CC;
  566. }
  567.  
  568. proc process_multilib_options { args } {
  569.     global board;
  570.     global board_variant_list;
  571.     global is_gdb_remote;
  572.  
  573.     set is_gdb_remote 0;
  574.  
  575.     if [board_info $board exists multilib_flags] {
  576.     return;
  577.     }
  578.     eval add_multilib_option $args;
  579.  
  580.     set multilib_flags "";
  581.  
  582.     foreach x $board_variant_list {
  583.     regsub -all "^\[ \t\]*" "$x" "" x;
  584.     regsub -all "\[ \t\]*$" "$x" "" x;
  585.  
  586.     if { $x == "" } {
  587.         continue;
  588.     }
  589.     case $x in {
  590.         { aout } {
  591.         set_board_info obj_format "a.out";
  592.         }
  593.         { elf } {
  594.         set_board_info obj_format "elf";
  595.         }
  596.         { pe } {
  597.         set_board_info obj_format "pe";
  598.         }
  599.         { ecoff } {
  600.         set_board_info obj_format "ecoff";
  601.         }
  602.         { stabs } {
  603.         set_board_info debug_flags "-gstabs";
  604.         }
  605.         { dwarf2 } {
  606.         set_board_info debug_flags "-gdwarf2";
  607.         }
  608.         { gdb*remote } {
  609.         set is_gdb_remote 1;
  610.         }
  611.         { little*endian el EL } {
  612.         append multilib_flags " -EL";
  613.         }
  614.         { big*endian eb EB } {
  615.         append multilib_flags " -EB";
  616.         }
  617.         { "soft*float" } {
  618.         append multilib_flags " -msoft-float"
  619.         }
  620.         { "-*" } {
  621.         append multilib_flags " $x";
  622.         }
  623.         default {
  624.         append multilib_flags " -m$x";
  625.         }
  626.     }
  627.     }
  628.     set_board_info multilib_flags $multilib_flags;
  629. }
  630.  
  631. proc add_multilib_option { args } {
  632.     global board_variant_list
  633.  
  634.     if ![info exists board_variant_list] {
  635.     set board_variant_list ""
  636.     }
  637.     set board_variant_list [concat $args $board_variant_list];
  638. }
  639.  
  640. proc find_gas { } {
  641.     global base_dir
  642.  
  643.     set AS ""
  644.  
  645.     if ![is_remote host] {
  646.     set AS [lookfor_file $base_dir as-new];
  647.     if { $AS == "" } {
  648.         set AS [lookfor_file $base_dir gas/as-new];
  649.     }
  650.     }
  651.     if { $AS == "" } {
  652.     set AS [transform as];
  653.     }
  654.     return $AS;
  655. }
  656.  
  657. proc build_wrapper { gluefile } {
  658.     global libdir
  659.  
  660.     if [target_info exists wrap_m68k_aout] {
  661.     set flags "additional_flags=-DWRAP_M68K_AOUT";
  662.     set result "";
  663.     } elseif [target_info exists uses_underscores] {
  664.     set flags "additional_flags=-DUNDERSCORES";
  665.     set result "-Wl,-wrap,__exit -Wl,-wrap,_main -Wl,-wrap,_abort";
  666.     } else {
  667.     set flags "";
  668.     if [target_info exists is_vxworks] {
  669.         set flags "additional_flags=-DVXWORKS";
  670.     }
  671.     set result "-Wl,-wrap,exit -Wl,-wrap,main -Wl,-wrap,abort";
  672.     }
  673.     if [target_info exists wrap_compile_flags] {
  674.     lappend flags "additional_flags=[target_info wrap_compile_flags]";
  675.     }
  676.     if { [target_compile ${libdir}/testglue.c ${gluefile} object $flags] == "" } {
  677.     set gluefile [remote_download host ${gluefile} testglue.o];
  678.     return [list $gluefile $result];
  679.     } else {
  680.     return ""
  681.     }
  682. }
  683.  
  684.  
  685. proc winsup_include_flags { args } {
  686.     global srcdir
  687.  
  688.     if [isnative] {
  689.     return ""
  690.     }
  691.  
  692.     if [is_remote host] {
  693.     return ""
  694.     }
  695.  
  696.     set gccpath "[get_multilibs]"
  697.  
  698.     if [file exists $gccpath/winsup] {
  699.     verbose "Winsup path is $gccpath/winsup"
  700.  
  701.     set winsup_dir [lookfor_file ${srcdir} winsup/include/windows]
  702.     if { ${winsup_dir} != "" } {
  703.         set winsup_dir [file dirname ${winsup_dir}]
  704.         return " -I${winsup_dir}"
  705.     }
  706.     }
  707.     verbose "No winsup support for this target"
  708.     
  709. }
  710. #
  711. # Find the winsup libraries in the current source tree.
  712. #
  713. proc winsup_link_flags { args } {
  714.     global base_dir
  715.  
  716.     # libgloss doesn't work native
  717.     if [isnative] {
  718.     return ""
  719.     }
  720.  
  721.     # if we're on a remote host, we can't search for the file, so we can only
  722.     # use an installed compiler, so we don't add any paths here.
  723.     if [is_remote host] {
  724.     return ""
  725.     }
  726.  
  727.     set gccpath "[get_multilibs]"
  728.  
  729.     verbose "Looking for $gccpath/winsup"
  730.     if [file exists $gccpath/winsup] {
  731.     verbose "Winsup path is $gccpath/newlib"
  732.     return "-B$gccpath/winsup/ -L$gccpath/winsup"
  733.     } else {
  734.     verbose "No winsup support for this target"
  735.     return ""
  736.     }
  737. }
  738.